# add_subdirectory(mesh)
# add_subdirectory(geom)
# add_subdirectory(fe)


set(_headers
)

set(_sources
        base/default_coupling.cpp
        base/dirichlet_boundary.cpp
        base/dof_map.cpp
        base/dof_map_constraints.cpp
        base/dof_object.cpp
        base/ghost_point_neighbors.cpp
        base/libmesh.cpp
        base/libmesh_common.cpp
        base/libmesh_singleton.cpp
        base/libmesh_version.cpp
        base/periodic_boundaries.cpp
        base/periodic_boundary.cpp
        base/periodic_boundary_base.cpp
        base/point_neighbor_coupling.cpp
        base/print_trace.cpp
        base/reference_counted_object.cpp
        base/reference_counter.cpp
        base/sibling_coupling.cpp
        base/single_predicates.cpp
        base/sparsity_pattern.cpp
        error_estimation/adjoint_refinement_estimator.cpp
        error_estimation/adjoint_residual_error_estimator.cpp
        error_estimation/discontinuity_measure.cpp
        error_estimation/error_estimator.cpp
        error_estimation/exact_error_estimator.cpp
        error_estimation/exact_solution.cpp
        error_estimation/fourth_error_estimators.cpp
        error_estimation/hp_coarsentest.cpp
        error_estimation/hp_selector.cpp
        error_estimation/hp_singular.cpp
        error_estimation/jump_error_estimator.cpp
        error_estimation/kelly_error_estimator.cpp
        error_estimation/patch_recovery_error_estimator.cpp
        error_estimation/uniform_refinement_estimator.cpp
        error_estimation/weighted_patch_recovery_error_estimator.cpp
        fe/fe.cpp
        fe/fe_abstract.cpp
        fe/fe_base.cpp
        fe/fe_bernstein.cpp
        fe/fe_bernstein_shape_0D.cpp
        fe/fe_bernstein_shape_1D.cpp
        fe/fe_bernstein_shape_2D.cpp
        fe/fe_bernstein_shape_3D.cpp
        fe/fe_boundary.cpp
        fe/fe_clough.cpp
        fe/fe_clough_shape_0D.cpp
        fe/fe_clough_shape_1D.cpp
        fe/fe_clough_shape_2D.cpp
        fe/fe_clough_shape_3D.cpp
        fe/fe_compute_data.cpp
        fe/fe_hermite.cpp
        fe/fe_hermite_shape_0D.cpp
        fe/fe_hermite_shape_1D.cpp
        fe/fe_hermite_shape_2D.cpp
        fe/fe_hermite_shape_3D.cpp
        fe/fe_hierarchic.cpp
        fe/fe_hierarchic_shape_0D.cpp
        fe/fe_hierarchic_shape_1D.cpp
        fe/fe_hierarchic_shape_2D.cpp
        fe/fe_hierarchic_shape_3D.cpp
        fe/fe_interface.cpp
        fe/fe_interface_inf_fe.cpp
        fe/fe_l2_hierarchic.cpp
        fe/fe_l2_lagrange.cpp
        fe/fe_lagrange.cpp
        fe/fe_lagrange_shape_0D.cpp
        fe/fe_lagrange_shape_1D.cpp
        fe/fe_lagrange_shape_2D.cpp
        fe/fe_lagrange_shape_3D.cpp
        fe/fe_lagrange_vec.cpp
        fe/fe_map.cpp
        fe/fe_monomial.cpp
        fe/fe_monomial_shape_0D.cpp
        fe/fe_monomial_shape_1D.cpp
        fe/fe_monomial_shape_2D.cpp
        fe/fe_monomial_shape_3D.cpp
        fe/fe_monomial_vec.cpp
        fe/fe_nedelec_one.cpp
        fe/fe_nedelec_one_shape_2D.cpp
        fe/fe_nedelec_one_shape_3D.cpp
        fe/fe_rational.cpp
        fe/fe_rational_shape_0D.cpp
        fe/fe_rational_shape_1D.cpp
        fe/fe_rational_shape_2D.cpp
        fe/fe_rational_shape_3D.cpp
        fe/fe_scalar.cpp
        fe/fe_scalar_shape_0D.cpp
        fe/fe_scalar_shape_1D.cpp
        fe/fe_scalar_shape_2D.cpp
        fe/fe_scalar_shape_3D.cpp
        fe/fe_side_hierarchic.cpp
        fe/fe_subdivision_2D.cpp
        fe/fe_szabab.cpp
        fe/fe_szabab_shape_0D.cpp
        fe/fe_szabab_shape_1D.cpp
        fe/fe_szabab_shape_2D.cpp
        fe/fe_szabab_shape_3D.cpp
        fe/fe_transformation_base.cpp
        fe/fe_type.cpp
        fe/fe_xyz.cpp
        fe/fe_xyz_boundary.cpp
        fe/fe_xyz_map.cpp
        fe/fe_xyz_shape_0D.cpp
        fe/fe_xyz_shape_1D.cpp
        fe/fe_xyz_shape_2D.cpp
        fe/fe_xyz_shape_3D.cpp
        fe/h1_fe_transformation.cpp
        fe/hcurl_fe_transformation.cpp
        fe/inf_fe.cpp
        fe/inf_fe_base_radial.cpp
        fe/inf_fe_boundary.cpp
        fe/inf_fe_jacobi_20_00_eval.cpp
        fe/inf_fe_jacobi_30_00_eval.cpp
        fe/inf_fe_lagrange_eval.cpp
        fe/inf_fe_legendre_eval.cpp
        fe/inf_fe_map.cpp
        fe/inf_fe_map_eval.cpp
        fe/inf_fe_static.cpp
        geom/bounding_box.cpp
        geom/cell.cpp
        geom/cell_hex.cpp
        geom/cell_hex20.cpp
        geom/cell_hex27.cpp
        geom/cell_hex8.cpp
        geom/cell_inf.cpp
        geom/cell_inf_hex.cpp
        geom/cell_inf_hex16.cpp
        geom/cell_inf_hex18.cpp
        geom/cell_inf_hex8.cpp
        geom/cell_inf_prism.cpp
        geom/cell_inf_prism12.cpp
        geom/cell_inf_prism6.cpp
        geom/cell_prism.cpp
        geom/cell_prism15.cpp
        geom/cell_prism18.cpp
        geom/cell_prism6.cpp
        geom/cell_pyramid.cpp
        geom/cell_pyramid13.cpp
        geom/cell_pyramid14.cpp
        geom/cell_pyramid5.cpp
        geom/cell_tet.cpp
        geom/cell_tet10.cpp
        geom/cell_tet4.cpp
        geom/edge.cpp
        geom/edge_edge2.cpp
        geom/edge_edge3.cpp
        geom/edge_edge4.cpp
        geom/edge_inf_edge2.cpp
        geom/elem.cpp
        geom/elem_cutter.cpp
        geom/elem_quality.cpp
        geom/elem_refinement.cpp
        geom/face.cpp
        geom/face_inf_quad.cpp
        geom/face_inf_quad4.cpp
        geom/face_inf_quad6.cpp
        geom/face_quad.cpp
        geom/face_quad4.cpp
        geom/face_quad4_shell.cpp
        geom/face_quad8.cpp
        geom/face_quad8_shell.cpp
        geom/face_quad9.cpp
        geom/face_tri.cpp
        geom/face_tri3.cpp
        geom/face_tri3_shell.cpp
        geom/face_tri3_subdivision.cpp
        geom/face_tri6.cpp
        geom/node.cpp
        geom/node_elem.cpp
        geom/plane.cpp
        geom/point.cpp
        geom/reference_elem.cpp
        geom/reference_elem.data 
        geom/remote_elem.cpp
        geom/sphere.cpp
        geom/surface.cpp
        mesh/abaqus_io.cpp
        mesh/boundary_info.cpp
        mesh/boundary_mesh.cpp
        mesh/checkpoint_io.cpp
        mesh/distributed_mesh.cpp
        mesh/dyna_io.cpp
        mesh/ensight_io.cpp
        mesh/exodusII_io.cpp
        mesh/exodusII_io_helper.cpp
        mesh/fro_io.cpp
        mesh/gmsh_io.cpp
        mesh/gmv_io.cpp
        mesh/gnuplot_io.cpp
        mesh/inf_elem_builder.cpp
        mesh/matlab_io.cpp
        mesh/medit_io.cpp
        mesh/mesh_base.cpp
        mesh/mesh_communication.cpp
        mesh/mesh_communication_global_indices.cpp
        mesh/mesh_function.cpp
        mesh/mesh_generation.cpp
        mesh/mesh_iterators.cpp
        mesh/mesh_modification.cpp
        mesh/mesh_output.cpp
        mesh/mesh_refinement.cpp
        mesh/mesh_refinement_flagging.cpp
        mesh/mesh_refinement_smoothing.cpp
        mesh/mesh_serializer.cpp
        mesh/mesh_smoother.cpp
        mesh/mesh_smoother_laplace.cpp
        mesh/mesh_smoother_vsmoother.cpp
        mesh/mesh_subdivision_support.cpp
        mesh/mesh_tetgen_interface.cpp
        mesh/mesh_tetgen_wrapper.cpp
        mesh/mesh_tools.cpp
        mesh/mesh_triangle_holes.cpp
        mesh/mesh_triangle_interface.cpp
        mesh/mesh_triangle_wrapper.cpp
        mesh/namebased_io.cpp
        mesh/nemesis_io.cpp
        mesh/nemesis_io_helper.cpp
        mesh/off_io.cpp
        mesh/patch.cpp
        mesh/postscript_io.cpp
        mesh/replicated_mesh.cpp
        mesh/tecplot_io.cpp
        mesh/tetgen_io.cpp
        mesh/ucd_io.cpp
        mesh/unstructured_mesh.cpp
        mesh/unv_io.cpp
        mesh/vtk_io.cpp
        mesh/xdr_io.cpp
        numerics/coupling_matrix.cpp
        numerics/dense_matrix.cpp
        numerics/dense_matrix_base.cpp
        numerics/dense_matrix_blas_lapack.cpp
        numerics/dense_submatrix.cpp
        numerics/dense_subvector.cpp
        numerics/dense_vector.cpp
        numerics/dense_vector_base.cpp
        numerics/diagonal_matrix.cpp
        numerics/distributed_vector.cpp
        numerics/eigen_preconditioner.cpp
        numerics/eigen_sparse_matrix.cpp
        numerics/eigen_sparse_vector.cpp
        numerics/laspack_matrix.cpp
        numerics/laspack_vector.cpp
        numerics/lumped_mass_matrix.cpp
        numerics/numeric_vector.cpp
        numerics/petsc_matrix.cpp
        numerics/petsc_preconditioner.cpp
        numerics/petsc_shell_matrix.cpp
        numerics/petsc_vector.cpp
        numerics/preconditioner.cpp
        numerics/shell_matrix.cpp
        numerics/sparse_matrix.cpp
        numerics/sparse_shell_matrix.cpp
        numerics/sum_shell_matrix.cpp
        numerics/tensor_shell_matrix.cpp
        numerics/tensor_tools.cpp
        numerics/trilinos_epetra_matrix.cpp
        numerics/trilinos_epetra_vector.cpp
        numerics/trilinos_preconditioner.cpp
        numerics/type_tensor.cpp
        numerics/type_vector.cpp
        numerics/wrapped_petsc.cpp
        parallel/parallel_bin_sorter.cpp
        parallel/parallel_elem.cpp
        parallel/parallel_ghost_sync.cpp
        parallel/parallel_histogram.cpp
        parallel/parallel_node.cpp
        parallel/parallel_sort.cpp
        parallel/threads.cpp
        partitioning/centroid_partitioner.cpp
        partitioning/linear_partitioner.cpp
        partitioning/mapped_subdomain_partitioner.cpp
        partitioning/metis_partitioner.cpp
        partitioning/parmetis_partitioner.cpp
        partitioning/partitioner.cpp
        partitioning/partitioner_factory.cpp
        partitioning/sfc_partitioner.cpp
        partitioning/subdomain_partitioner.cpp
        physics/diff_physics.cpp
        physics/diff_qoi.cpp
        physics/fem_physics.cpp
        quadrature/quadrature.cpp
        quadrature/quadrature_build.cpp
        quadrature/quadrature_clough.cpp
        quadrature/quadrature_clough_1D.cpp
        quadrature/quadrature_clough_2D.cpp
        quadrature/quadrature_clough_3D.cpp
        quadrature/quadrature_composite.cpp
        quadrature/quadrature_conical.cpp
        quadrature/quadrature_conical_2D.cpp
        quadrature/quadrature_conical_3D.cpp
        quadrature/quadrature_gauss.cpp
        quadrature/quadrature_gauss_1D.cpp
        quadrature/quadrature_gauss_2D.cpp
        quadrature/quadrature_gauss_3D.cpp
        quadrature/quadrature_gauss_lobatto.cpp
        quadrature/quadrature_gauss_lobatto_1D.cpp
        quadrature/quadrature_gauss_lobatto_2D.cpp
        quadrature/quadrature_gauss_lobatto_3D.cpp
        quadrature/quadrature_gm.cpp
        quadrature/quadrature_gm_2D.cpp
        quadrature/quadrature_gm_3D.cpp
        quadrature/quadrature_grid.cpp
        quadrature/quadrature_grid_1D.cpp
        quadrature/quadrature_grid_2D.cpp
        quadrature/quadrature_grid_3D.cpp
        quadrature/quadrature_jacobi.cpp
        quadrature/quadrature_jacobi_1D.cpp
        quadrature/quadrature_monomial.cpp
        quadrature/quadrature_monomial_1D.cpp
        quadrature/quadrature_monomial_2D.cpp
        quadrature/quadrature_monomial_3D.cpp
        quadrature/quadrature_nodal.cpp
        quadrature/quadrature_nodal_1D.cpp
        quadrature/quadrature_nodal_2D.cpp
        quadrature/quadrature_nodal_3D.cpp
        quadrature/quadrature_simpson.cpp
        quadrature/quadrature_simpson_1D.cpp
        quadrature/quadrature_simpson_2D.cpp
        quadrature/quadrature_simpson_3D.cpp
        quadrature/quadrature_trap.cpp
        quadrature/quadrature_trap_1D.cpp
        quadrature/quadrature_trap_2D.cpp
        quadrature/quadrature_trap_3D.cpp
        reduced_basis/rb_assembly_expansion.cpp
        reduced_basis/rb_construction.cpp
        reduced_basis/rb_construction_base.cpp
        reduced_basis/rb_data_deserialization.cpp
        reduced_basis/rb_data_serialization.cpp
        reduced_basis/rb_eim_assembly.cpp
        reduced_basis/rb_eim_construction.cpp
        reduced_basis/rb_eim_evaluation.cpp
        reduced_basis/rb_eim_theta.cpp
        reduced_basis/rb_evaluation.cpp
        reduced_basis/rb_parameters.cpp
        reduced_basis/rb_parametrized.cpp
        reduced_basis/rb_parametrized_function.cpp
        reduced_basis/rb_scm_construction.cpp
        reduced_basis/rb_scm_evaluation.cpp
        reduced_basis/rb_temporal_discretization.cpp
        reduced_basis/rb_theta.cpp
        reduced_basis/rb_theta_expansion.cpp
        reduced_basis/transient_rb_assembly_expansion.cpp
        reduced_basis/transient_rb_construction.cpp
        reduced_basis/transient_rb_evaluation.cpp
        reduced_basis/transient_rb_theta_expansion.cpp
        solution_transfer/boundary_volume_solution_transfer.cpp
        solution_transfer/direct_solution_transfer.cpp
        solution_transfer/dtk_adapter.cpp
        solution_transfer/dtk_evaluator.cpp
        solution_transfer/dtk_solution_transfer.cpp
        solution_transfer/meshfree_interpolation.cpp
        solution_transfer/meshfree_solution_transfer.cpp
        solution_transfer/meshfunction_solution_transfer.cpp
        solution_transfer/radial_basis_interpolation.cpp
        solution_transfer/solution_transfer.cpp
        solvers/adaptive_time_solver.cpp
        solvers/diff_solver.cpp
        solvers/eigen_solver.cpp
        solvers/eigen_sparse_linear_solver.cpp
        solvers/eigen_time_solver.cpp
        solvers/euler2_solver.cpp
        solvers/euler_solver.cpp
        solvers/file_solution_history.cpp
        solvers/first_order_unsteady_solver.cpp
        solvers/laspack_linear_solver.cpp
        solvers/linear_solver.cpp
        solvers/memory_solution_history.cpp
        solvers/newmark_solver.cpp
        solvers/newton_solver.cpp
        solvers/nlopt_optimization_solver.cpp
        solvers/no_solution_history.cpp
        solvers/nonlinear_solver.cpp
        solvers/optimization_solver.cpp
        solvers/petsc_auto_fieldsplit.cpp
        solvers/petsc_diff_solver.cpp
        solvers/petsc_dm_wrapper.cpp
        solvers/petsc_linear_solver.cpp
        solvers/petsc_nonlinear_solver.cpp
        solvers/petscdmlibmesh.cpp
        solvers/petscdmlibmeshimpl.cpp
        solvers/second_order_unsteady_solver.cpp
        solvers/slepc_eigen_solver.cpp
        solvers/steady_solver.cpp
        solvers/tao_optimization_solver.cpp
        solvers/time_solver.cpp
        solvers/trilinos_aztec_linear_solver.cpp
        solvers/trilinos_nox_nonlinear_solver.cpp
        solvers/twostep_time_solver.cpp
        solvers/unsteady_solver.cpp
        systems/condensed_eigen_system.cpp
        systems/continuation_system.cpp
        systems/dg_fem_context.cpp
        systems/diff_context.cpp
        systems/diff_system.cpp
        systems/eigen_system.cpp
        systems/equation_systems.cpp
        systems/equation_systems_io.cpp
        systems/explicit_system.cpp
        systems/fem_context.cpp
        systems/fem_system.cpp
        systems/frequency_system.cpp
        systems/implicit_system.cpp
        systems/inter_mesh_projection.cpp
        systems/linear_implicit_system.cpp
        systems/newmark_system.cpp
        systems/nonlinear_implicit_system.cpp
        systems/optimization_system.cpp
        systems/parameter_vector.cpp
        systems/qoi_set.cpp
        systems/steady_system.cpp
        systems/system.cpp
        systems/system_io.cpp
        systems/system_norm.cpp
        systems/system_projection.cpp
        systems/system_subset.cpp
        systems/system_subset_by_subdomain.cpp
        systems/transient_system.cpp
        utils/error_vector.cpp
        utils/hashword.cpp
        utils/location_maps.cpp
        utils/number_lookups.cpp
        utils/perf_log.cpp
        utils/plt_loader.cpp
        utils/plt_loader_read.cpp
        utils/plt_loader_write.cpp
        utils/point_locator_base.cpp
        utils/point_locator_nanoflann.cpp
        utils/point_locator_tree.cpp
        utils/statistics.cpp
        utils/string_to_enum.cpp
        utils/timestamp.cpp
        utils/topology_map.cpp
        utils/tree.cpp
        utils/tree_node.cpp
        utils/utility.cpp
        utils/xdr_cxx.cpp 
)

add_library(trestle ${_sources})

target_link_libraries(trestle PUBLIC _compiler_flags)
target_link_libraries(trestle PUBLIC timpi)

find_package(VTK COMPONENTS
IOExodus
#FiltersGeneral
#AcceleratorsVTKmDataModel
REQUIRED)

target_link_libraries(trestle PUBLIC ${VTK_LIBRARIES})






add_subdirectory(apps)